<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  </head>
  <body>
    <div id="root">
      <h2 v-show="true">欢迎来到{{name}}</h2>
      <h2 v-if="1 === 0">欢迎来到{{name}}</h2>
      <div v-show="isShow">Angular</div>
      <div v-show="isShow">React</div>
      <div v-show="isShow">Vue</div>
      <button @click="change">点击切换显示</button>
      <!-- v-if 与 template结合 -->
      <template v-if="n === 1">
          <h2>你好</h2>
          <h2>尚硅谷</h2>
          <h2>北京</h2>
      </template>
    </div>

    <script>
      new Vue({
        el: "#root",
        data: {
          name: "睡觉",
          isShow: 1,
        },
        methods: {
            change() {
                this.isShow = (this.isShow + 1) % 3 + 1
            }
        },
      });
    </script>
  </body>
</html>
